<?php

abstract class Controller {

    public function __construct() {

        @session_start();
        $this->view = new View();
        $this->detectViwer = new Mobile_Detect();
    }
    
    public function LoadModel($name) {

        $path = 'model/'.$name.'_model.php';
        
        if(file_exists($path))
        {
            require $path;
            $modelName = $name.'_Model';
            $this->model = new $modelName();            
        }
        else //Load basis Model
        {
            $this->model = new Model();
        }
        
        $this->view->model = $this->model;
        
    }
    
    abstract function index();
}
